<?php
class Acl extends Zend_Acl {

    public function __construct()
    {
       
        $this->addRole(new Zend_Acl_Role('cliente'));
        $this->addRole(new Zend_Acl_Role('admin'), 'cliente');
        $this->addRole(new Zend_Acl_Role('guest'));

        /**
         * Adicionar controller.
         */
        $this->addResource('index');
        $this->addResource('error');
        $this->addResource('acesso');
        $this->addResource('cliente');
        $this->addResource('usuario');
        $this->addResource('banco');
        $this->addResource('filial');
        $this->addResource('emprestimo');
        
	/**
		 * Permitir o controller / action a alguem.
		 */
        $this->allow('admin', array('cliente', 'usuario', 'banco', 'filial', 'emprestimo'));
        
        $this->allow('cliente', array('index', 'error', 'acesso'));
        $this->allow('cliente', 'cliente', array('listar', 'show'));
        $this->allow('cliente', 'usuario', array('editar'));
        $this->allow('cliente', 'emprestimo', array('listar', 'ver-arquivo'));
                
        $this->allow('guest', 'acesso', array('login'));
        $this->allow('guest', array('error'));
                
        $this->deny('guest', array('index'));      
    }
    

}